<?php

namespace app\user\validate;

use think\Validate;

class Register extends Validate
{
    protected $rule = [
        'username' => 'require|min:4|max:16|unique:user',
        'mobile'   => 'require|unique:user',
        'password' => 'require|confirm|min:6|max:16',
    ];

    protected $message = [
        'username.unique'    => '用户名已存在',
        'username.require' => '用户名不能为空',
        'username.min'     => '用户名长度不能小于4位',
        'username.max'     => '用户名长度不能大于16位',
        'mobile.require'   => '手机号不能为空',
        'mobile.unique'    => '手机号已存在',
        'password.min'     => '密码长度不能小于6位',
        'password.max'     => '密码长度不能大于16位',
    ];
}
